NotePlayer Class

Plays musical notes via the QuickTime on Macintosh and the MIDI functions on Windows.

Events

None

Properties

Index

Instrument

Left

Name

Top


Methods

PlayNote


More information available in parent classes: Control:Object

Because this is a Control, see the Control class for other properties and events that are common to all Control objects.


Notes

When calling the PlayNote method, the pitch is represented as a number from 0 to 127 where middle C is 60. Incrementing by 1 raises the pitch by a half step. Decreasing by 1 decreases the pitch by a half step. You can also express the value of pitch as a number from 256 to 32767, i.e. pitch*256. Use this to specify half-steps. For example, if you want a pitch of 60.5, specify 60.5*256=15488 as the value of Pitch.

The velocity parameter is a scale from 0 to 127 that represents how hard the key is pressed. 127 represents a very hard key press. 0 represents the key no longer being pressed. When calling the PlayNote method, the note played will continue to play until it is played again with a velocity of 0.

Linux

The NotePlayer is not supported on Linux.


Instruments

InstrumentValueInstrumentValue
Acoustic Grand Piano 1 Soprano Sax 65
Bright Acoustic Piano 2 Alto Sax 66
Electric Grand Piano 3 Tenor Sax 67
Honky-tonk Piano 4 Baritone Sax 68
Rhodes Piano 5 Oboe 69
Chorused Piano 6 English Horn 70
Harpsichord 7 Bassoon 71
Clavinet 8 Clarinet 72
Celesta 9 Piccolo 73
Glockenspiel 10 Flute 74
Music Box 11 Recorder 75
Vibraphone 12 Pan Flute 76
Marimba 13 Bottle blow 77
Xylophone 14 Shakuhachi 78
Tubular bells 15 Whistle 79
Dulcimer 16 Ocarina 80
Draw Organ 17 Square Lead 81
Percussive Organ 18 Saw Lead 82
Rock Organ 19 Calliope 83
Church Organ 20 Chiffer 84
Reed Organ 21 Synth Lead 5 85
Accordion 22 Synth Lead 6 86
Harmonica 23 Synth Lead 7 87
Tango Accordion 24 Synth Lead 8 88
Acoustic Nylon Guitar 25 Synth Pad 1 89
Acoustic Steel Guitar 26 Synth Pad 2 90
Electric Jazz Guitar 27 Synth Pad 3 91
Electric clean Guitar 28 Synth Pad 4 92
Electric Guitar muted 29 Synth Pad 5 93
Overdriven Guitar 30 Synth Pad 6 94
Distortion Guitar 31 Synth Pad 7 95
Guitar Harmonics 32 Synth Pad 8 96
Wood Bass 33 Ice Rain 97
Electric Bass Fingered 34 Soundtracks 98
Electric Bass Picked 35 Crystal 99
Fretless Bass 36 Atmosphere 100
Slap Bass 1 37 Bright 101
Slap Bass 2 38 Goblin 102
Synth Bass 1 39 Echoes 103
Synth Bass 2 40 Space 104
Violin 41 Sitar 105
Viola 42 Banjo 106
Cello 43 Shamisen 107
Contrabass 44 Koto 108
Tremolo Strings 45 Kalimba 109
Pizzicato Strings 46 Bagpipe 110
Orchestral Harp 47 Fiddle 111
Timpani 48 Shanai 112
Acoustic String Ensemble 1 49 Tinkle bell 113
Acoustic String Ensemble 2 50 Agogo 114
Synth Strings 1 51 Steel Drums 115
Synth Strings 2 52 Woodblock 116
Aah Choir 53 Taiko Drum 117
Ooh Choir 54 Melodic Tom 118
Synvox 55 Synth Tom 119
Orchestra Hit 56 Reverse Cymbal 120
Trumpet 57 Guitar Fret Noise 121
Trombone 58 Breath Noise 122
Tuba 59 Seashore 123
Muted Trumpet 60 Bird Tweet 124
French Horn 61 Telephone Ring 125
Brass Section 62 Helicopter 126
Synth Brass 1 63 Applause 127
Synth Brass 2 64 Gunshot Table 128
Drum Kit 16385


Examples

The following plays a note on the 'Church Organ' instrument:

NotePlayer1.Instrument=20
NotePlayer1.PlayNote(60,60)

The following line of code stops the note:

NotePlayer1.PlayNote(60,0)

See Also

Control class.